home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / PInterfaces / GXEnvironment.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  7.2 KB  |  231 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        GXEnvironment.p
  3.  
  4.      Contains:    QuickDraw GX environment constants and interfaces
  5.  
  6.      Version:    Technology:    Quickdraw GX 1.1
  7.                  Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT GXEnvironment;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __GXENVIRONMENT__}
  30. {$SETC __GXENVIRONMENT__ := 1}
  31.  
  32. {$I+}
  33. {$SETC GXEnvironmentIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __CONDITIONALMACROS__}
  38. {$I ConditionalMacros.p}
  39. {$ENDC}
  40.  
  41. {$IFC UNDEFINED __MIXEDMODE__}
  42. {$I MixedMode.p}
  43. {$ENDC}
  44. {    Types.p                                                        }
  45.  
  46. {$IFC UNDEFINED __WINDOWS__}
  47. {$I Windows.p}
  48. {$ENDC}
  49. {    Memory.p                                                    }
  50. {    Quickdraw.p                                                    }
  51. {        QuickdrawText.p                                            }
  52. {    Events.p                                                    }
  53. {        OSUtils.p                                                }
  54. {    Controls.p                                                    }
  55. {        Menus.p                                                    }
  56.  
  57. {$IFC UNDEFINED __GXTYPES__}
  58. {$I GXTypes.p}
  59. {$ENDC}
  60. {    GXMath.p                                                    }
  61. {        FixMath.p                                                }
  62.  
  63. {$PUSH}
  64. {$ALIGN MAC68K}
  65. {$LibExport+}
  66. {$SETC graphicsMacintoshIncludes := 1}
  67.  
  68. CONST
  69.     defaultPollingHandlerFlags    = $00;
  70.     okToSwitchDuringPollFlag    = $00;
  71.     dontSwitchDuringPollFlag    = $01;
  72.  
  73.     
  74. TYPE
  75.     gxPollingHandlerFlags = LONGINT;
  76.  
  77.     gxPollingHandlerProcPtr = ProcPtr;  { PROCEDURE gxPollingHandler(reference: LONGINT; flags: gxPollingHandlerFlags); }
  78.     gxPollingHandlerUPP = UniversalProcPtr;
  79.  
  80. CONST
  81.     uppgxPollingHandlerProcInfo = $000003C1; { PROCEDURE (4 byte param, 4 byte param); }
  82.  
  83. FUNCTION NewgxPollingHandlerProc(userRoutine: gxPollingHandlerProcPtr): gxPollingHandlerUPP;
  84.     {$IFC NOT GENERATINGCFM }
  85.     INLINE $2E9F;
  86.     {$ENDC}
  87.  
  88. PROCEDURE CallgxPollingHandlerProc(reference: LONGINT; flags: gxPollingHandlerFlags; userRoutine: gxPollingHandlerUPP);
  89.     {$IFC NOT GENERATINGCFM}
  90.     INLINE $205F, $4E90;
  91.     {$ENDC}
  92.  
  93. FUNCTION GXGetGraphicsPollingHandler(VAR reference: LONGINT): gxPollingHandlerUPP; C;
  94. PROCEDURE GXSetGraphicsPollingHandler(handler: gxPollingHandlerUPP; reference: LONGINT); C;
  95. {$SETC graphicsToolboxIncludes := 1}
  96. { QD to QD GX Translator typedefs }
  97.  
  98. CONST
  99.     gxDefaultOptionsTranslation    = $0000;
  100.     gxOptimizedTranslation        = $0001;
  101.     gxReplaceLineWidthTranslation = $0002;
  102.     gxSimpleScalingTranslation    = $0004;
  103.     gxSimpleGeometryTranslation    = $0008;                        { implies simple scaling }
  104.     gxSimpleLinesTranslation    = $000C;                        { implies simple geometry & scaling }
  105.     gxLayoutTextTranslation        = $0010;                        { turn on gxLine layout (normally off) }
  106.     gxRasterTargetTranslation    = $0020;
  107.     gxPostScriptTargetTranslation = $0040;
  108.     gxVectorTargetTranslation    = $0080;
  109.  
  110.     
  111. TYPE
  112.     gxTranslationOption = LONGINT;
  113.  
  114.  
  115. CONST
  116.     gxContainsFormsBegin        = $0001;
  117.     gxContainsFormsEnd            = $0002;
  118.     gxContainsPostScript        = $0004;
  119.     gxContainsEmptyPostScript    = $0008;
  120.  
  121.     
  122. TYPE
  123.     gxTranslationStatistic = LONGINT;
  124.  
  125.  
  126. CONST
  127.     gxQuickDrawPictTag            = 'pict';
  128.  
  129.  
  130. TYPE
  131.     gxQuickDrawPict = RECORD
  132.         { translator inputs }
  133.         options:                gxTranslationOption;
  134.         srcRect:                Rect;
  135.         styleStretch:            Point;
  136.         { size of quickdraw picture data }
  137.         dataLength:                LONGINT;
  138.         { file alias }
  139.         alias:                    gxBitmapDataSourceAlias;
  140.     END;
  141.  
  142. { WindowRecord utilities }
  143.  
  144. FUNCTION GXNewWindowViewPort(qdWindow: WindowPtr): gxViewPort; C;
  145. FUNCTION GXGetWindowViewPort(qdWindow: WindowPtr): gxViewPort; C;
  146. FUNCTION GXGetViewPortWindow(portOrder: gxViewPort): WindowPtr; C;
  147. { GDevice utilities }
  148. FUNCTION GXGetViewDeviceGDevice(theDevice: gxViewDevice): GDHandle; C;
  149. FUNCTION GXGetGDeviceViewDevice(qdGDevice: GDHandle): gxViewDevice; C;
  150. { gxPoint utilities }
  151. PROCEDURE GXConvertQDPoint({CONST}VAR shortPt: Point; portOrder: gxViewPort; VAR fixedPt: gxPoint); C;
  152. { printing utilities typedef }
  153. TYPE
  154.     gxShapeSpoolProcPtr = ProcPtr;  { FUNCTION gxShapeSpool(toSpool: gxShape; refCon: LONGINT): OSErr; }
  155.     gxUserViewPortFilterProcPtr = ProcPtr;  { PROCEDURE gxUserViewPortFilter(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT); }
  156.     gxConvertQDFontProcPtr = ProcPtr;  { FUNCTION gxConvertQDFont(dst: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; }
  157.     gxShapeSpoolUPP = UniversalProcPtr;
  158.     gxUserViewPortFilterUPP = UniversalProcPtr;
  159.     gxConvertQDFontUPP = UniversalProcPtr;
  160.  
  161. CONST
  162.     uppgxShapeSpoolProcInfo = $000003E1; { FUNCTION (4 byte param, 4 byte param): 2 byte result; }
  163.     uppgxUserViewPortFilterProcInfo = $00000FC1; { PROCEDURE (4 byte param, 4 byte param, 4 byte param); }
  164.     uppgxConvertQDFontProcInfo = $00000FF1; { FUNCTION (4 byte param, 4 byte param, 4 byte param): 4 byte result; }
  165.  
  166. FUNCTION NewgxShapeSpoolProc(userRoutine: gxShapeSpoolProcPtr): gxShapeSpoolUPP;
  167.     {$IFC NOT GENERATINGCFM }
  168.     INLINE $2E9F;
  169.     {$ENDC}
  170.  
  171. FUNCTION NewgxUserViewPortFilterProc(userRoutine: gxUserViewPortFilterProcPtr): gxUserViewPortFilterUPP;
  172.     {$IFC NOT GENERATINGCFM }
  173.     INLINE $2E9F;
  174.     {$ENDC}
  175.  
  176. FUNCTION NewgxConvertQDFontProc(userRoutine: gxConvertQDFontProcPtr): gxConvertQDFontUPP;
  177.     {$IFC NOT GENERATINGCFM }
  178.     INLINE $2E9F;
  179.     {$ENDC}
  180.  
  181. FUNCTION CallgxShapeSpoolProc(toSpool: gxShape; refCon: LONGINT; userRoutine: gxShapeSpoolUPP): OSErr;
  182.     {$IFC NOT GENERATINGCFM}
  183.     INLINE $205F, $4E90;
  184.     {$ENDC}
  185.  
  186. PROCEDURE CallgxUserViewPortFilterProc(toFilter: gxShape; portOrder: gxViewPort; refCon: LONGINT; userRoutine: gxUserViewPortFilterUPP);
  187.     {$IFC NOT GENERATINGCFM}
  188.     INLINE $205F, $4E90;
  189.     {$ENDC}
  190.  
  191. FUNCTION CallgxConvertQDFontProc(dst: gxStyle; txFont: LONGINT; txFace: LONGINT; userRoutine: gxConvertQDFontUPP): LONGINT;
  192.     {$IFC NOT GENERATINGCFM}
  193.     INLINE $205F, $4E90;
  194.     {$ENDC}
  195.     
  196. TYPE
  197.     gxShapeSpoolFunction = gxShapeSpoolUPP;
  198.  
  199.     gxUserViewPortFilter = gxUserViewPortFilterUPP;
  200.  
  201.     gxConvertQDFontFunction = gxConvertQDFontUPP;
  202.  
  203. { mouse utilities }
  204. { return mouse location in fixed-gxPoint global space }
  205.  
  206. PROCEDURE GXGetGlobalMouse(VAR globalPt: gxPoint); C;
  207. { return fixed-gxPoint local mouse (gxViewPort == 0 --> default) }
  208. PROCEDURE GXGetViewPortMouse(portOrder: gxViewPort; VAR localPt: gxPoint); C;
  209. { printing utilities }
  210. FUNCTION GXGetViewPortFilter(portOrder: gxViewPort; VAR refCon: LONGINT): gxUserViewPortFilter; C;
  211. PROCEDURE GXSetViewPortFilter(portOrder: gxViewPort; filter: gxUserViewPortFilter; refCon: LONGINT); C;
  212. { QD to QD GX Translator functions }
  213. PROCEDURE GXInstallQDTranslator(port: GrafPtr; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStrech: Point; userFunction: gxShapeSpoolUPP; reference: UNIV Ptr); C;
  214. FUNCTION GXRemoveQDTranslator(port: GrafPtr; VAR statistic: gxTranslationStatistic): gxTranslationStatistic; C;
  215. FUNCTION GXConvertPICTToShape(pict: PicHandle; options: gxTranslationOption; {CONST}VAR srcRect: Rect; {CONST}VAR dstRect: Rect; styleStretch: Point; destination: gxShape; VAR stats: gxTranslationStatistic): gxShape; C;
  216. { Find the best GX style given a QD font and face. Called by the QD->GX translator }
  217. FUNCTION GXConvertQDFont(theStyle: gxStyle; txFont: LONGINT; txFace: LONGINT): LONGINT; C;
  218. FUNCTION GXGetConvertQDFont: gxConvertQDFontUPP; C;
  219. PROCEDURE GXSetConvertQDFont(userFunction: gxConvertQDFontUPP); C;
  220.  
  221. {$ALIGN RESET}
  222. {$POP}
  223.  
  224. {$SETC UsingIncludes := GXEnvironmentIncludes}
  225.  
  226. {$ENDC} {__GXENVIRONMENT__}
  227.  
  228. {$IFC NOT UsingIncludes}
  229.  END.
  230. {$ENDC}
  231.